#!/usr/bin/env python
import xmlrpclib,pprint

server = xmlrpclib.Server('http://adam:fred123@localhost/zidestore/so/adam/')
criteria1 = { }
criteria1['conjunction'] = 'AND'
criteria1['key'] = 'address.state'
criteria1['value'] = 'NY'
criteria1['expression'] = 'EQUALS'
criteria2 = { }
criteria2['conjunction'] = 'AND'
criteria2['key'] = 'division'
criteria2['value'] = 'MVP'
criteria2['expression'] = 'EQUALS'
query = [ criteria1, criteria2 ]
flags = { 'limit' : 150, 'filter' : '((objectId = 4159230) OR (objectId = 4879170) OR (objectId = 4190580) OR (objectId = 4895890) OR (objectId = 4878840) OR (objectId = 1701620) OR (objectId = 2648180) OR (objectId = 8851410) OR (objectId = 4651430) OR (objectId = 3041890) OR (objectId = 2347050) OR (objectId = 9585620) OR (objectId = 2013880) OR (objectId = 8741940) OR (objectId = 8818850) OR (objectId = 9203860) OR (objectId = 10460) OR (objectId = 4626190) OR (objectId = 4502720) OR (objectId = 9182670) OR (objectId = 4502180) OR (objectId = 2258900) OR (objectId = 2681370) OR (objectId = 8769370) OR (objectId = 1423720) OR (objectId = 4143970) OR (objectId = 2222560) OR (objectId = 2164710) OR (objectId = 1728030) OR (objectId = 2653300) OR (objectId = 4896190) OR (objectId = 2431860) OR (objectId = 1922770) OR (objectId = 2086830) OR (objectId = 4656270) OR (objectId = 4896490) OR (objectId = 8059270) OR (objectId = 1448010) OR (objectId = 9183510) OR (objectId = 8792270) OR (objectId = 2934370) OR (objectId = 2683930) OR (objectId = 1559180) OR (objectId = 2244030) OR (objectId = 2283950) OR (objectId = 2263850) OR (objectId = 2264950) OR (objectId = 2315880) OR (objectId = 2349250) OR (objectId = 2390260) OR (objectId = 2421110) OR (objectId = 2430210) OR (objectId = 1548990) OR (objectId = 1610740) OR (objectId = 1695570) OR (objectId = 1760760) OR (objectId = 1768190) OR (objectId = 1859990) OR (objectId = 1885620) OR (objectId = 1979990) OR (objectId = 2225040) OR (objectId = 2349800) OR (objectId = 2351450) OR (objectId = 2382560) OR (objectId = 2309270) OR (objectId = 2314780) OR (objectId = 2335160) OR (objectId = 2357230) OR (objectId = 2377060) OR (objectId = 2388610) OR (objectId = 2384760) OR (objectId = 2388060) OR (objectId = 2398270) OR (objectId = 2409000) OR (objectId = 2643700) OR (objectId = 2645620) OR (objectId = 2646900) OR (objectId = 2657290) OR (objectId = 2661240) OR (objectId = 2673540) OR (objectId = 2678100) OR (objectId = 2685850) OR (objectId = 2629800) OR (objectId = 2704710) OR (objectId = 2724550) OR (objectId = 2732230) OR (objectId = 2739270) OR (objectId = 2744390) OR (objectId = 2755270) OR (objectId = 2840930) OR (objectId = 2841570) OR (objectId = 2842210) OR (objectId = 2845410) OR (objectId = 2927330) OR (objectId = 2847330) OR (objectId = 2847970) OR (objectId = 2848610) OR (objectId = 2849250) OR (objectId = 2849890) OR (objectId = 2971490) OR (objectId = 3016290) OR (objectId = 3024610) OR (objectId = 3068130) OR (objectId = 3072610) OR (objectId = 3073250) OR (objectId = 3078370) OR (objectId = 3086690) OR (objectId = 3087330) OR (objectId = 3107170) OR (objectId = 3111650) OR (objectId = 1377500) OR (objectId = 1378050) OR (objectId = 1451860) OR (objectId = 1457360) OR (objectId = 1528080) OR (objectId = 1590320) OR (objectId = 1642410) OR (objectId = 1650120) OR (objectId = 1648740) OR (objectId = 1658930) OR (objectId = 1676260) OR (objectId = 1704370) OR (objectId = 1774800) OR (objectId = 1845940) OR (objectId = 1851720) OR (objectId = 1866320) OR (objectId = 1898280) OR (objectId = 1987150) OR (objectId = 2010020) OR (objectId = 2047160) OR (objectId = 4147060) OR (objectId = 2143520) OR (objectId = 2145170) OR (objectId = 2156460) OR (objectId = 2160860) OR (objectId = 2202470) OR (objectId = 2209900) OR (objectId = 2240180) OR (objectId = 2239080) OR (objectId = 2255050) OR (objectId = 2255600) OR (objectId = 8031150) OR (objectId = 2268530) OR (objectId = 4652850) OR (objectId = 2274030) OR (objectId = 2276790) OR (objectId = 2290550) OR (objectId = 2298810) OR (objectId = 2180980) OR (objectId = 2184280) OR (objectId = 2184830) OR (objectId = 4591830) OR (objectId = 2163060) OR (objectId = 4636660) OR (objectId = 4666640) OR (objectId = 4666940) OR (objectId = 4864380) OR (objectId = 4611090) OR (objectId = 2231650) OR (objectId = 4935320) OR (objectId = 4653990) OR (objectId = 1544860) OR (objectId = 3041250) OR (objectId = 9089060) OR (objectId = 2210450) OR (objectId = 2211550) OR (objectId = 1635800) OR (objectId = 1636350) OR (objectId = 3991080) OR (objectId = 4016410) OR (objectId = 1985500) OR (objectId = 4147730) OR (objectId = 1636900) OR (objectId = 4615450) OR (objectId = 4615750) OR (objectId = 4048320) OR (objectId = 9183790) OR (objectId = 1638000) OR (objectId = 2026260) OR (objectId = 2361360) OR (objectId = 4685650) OR (objectId = 4686520) OR (objectId = 4893080) OR (objectId = 9095130) OR (objectId = 2041660) OR (objectId = 1653420) OR (objectId = 5066970) OR (objectId = 5067960) OR (objectId = 5068950) OR (objectId = 5069620) OR (objectId = 2350900) OR (objectId = 1579010) OR (objectId = 5265810) OR (objectId = 4659760) OR (objectId = 7837800) OR (objectId = 4690870) OR (objectId = 4693780) OR (objectId = 4691220) OR (objectId = 4707880) OR (objectId = 7863450) OR (objectId = 7863740) OR (objectId = 7864060) OR (objectId = 7864950) OR (objectId = 4163650) OR (objectId = 2245690) OR (objectId = 7985410) OR (objectId = 7987310) OR (objectId = 4190280) OR (objectId = 2399920) OR (objectId = 4189980) OR (objectId = 2305420) OR (objectId = 2333510) OR (objectId = 8500110) OR (objectId = 2068630) OR (objectId = 8581220) OR (objectId = 9093870) OR (objectId = 9184070) OR (objectId = 1966790) OR (objectId = 2218710) OR (objectId = 2346500) OR (objectId = 4877000) OR (objectId = 4616110) OR (objectId = 2211000) OR (objectId = 4608820) OR (objectId = 4152500) OR (objectId = 9106840) OR (objectId = 1902690) OR (objectId = 1907640) OR (objectId = 2241280) OR (objectId = 7966170) OR (objectId = 2130040) OR (objectId = 2134720) OR (objectId = 4617040) OR (objectId = 2252850) OR (objectId = 2261100) OR (objectId = 2368260) OR (objectId = 2368810) OR (objectId = 2371560) OR (objectId = 9183140) OR (objectId = 2396620) OR (objectId = 9160460) OR (objectId = 4655930) OR (objectId = 9184350) OR (objectId = 9184890) OR (objectId = 9185170) OR (objectId = 9186170) OR (objectId = 9186530) OR (objectId = 9187260) OR (objectId = 9187580) OR (objectId = 9187900) OR (objectId = 9188180) OR (objectId = 9194220) OR (objectId = 9194510) OR (objectId = 9194790) OR (objectId = 9195770) OR (objectId = 9222910) OR (objectId = 9223200) OR (objectId = 9223480) OR (objectId = 9223980) OR (objectId = 9224280) OR (objectId = 9224730) OR (objectId = 9225390) OR (objectId = 9243530) OR (objectId = 9272530) OR (objectId = 9272840) OR (objectId = 9273420) OR (objectId = 9273130) OR (objectId = 9245430) OR (objectId = 4603150)) AND (url != NULL)' }
result = server.zogi.searchForObjects('Enterprise', query, 0, flags)
for enterprise in result:
  print('%d:%s - %s' % (enterprise['objectId'], enterprise['name'], enterprise['url']))
